<select id="cate_id" name="cate_id" class="input input-auto">
	<option value="0">请选择</option>
</select>
<script id="cateid_list_tpl" type="text/html">
	{{# for(var i = 0, len = d.data.length; i < len; i++){ }}
		<option {{# if(d.data[i].id==cate_id){}}selected{{#}}} value="{{ d.data[i].id }}">{{ d.data[i].title }}</option>
	{{# } }}
</script>
<script>
	var func = false;
	$('select').click(function(){
		func = true;
	});
	function start(){
        $.getJSON('__ROOT__/admin/{$Request.controller}/get_seller_category?aid='+aid, {}, function(res){
            if(res.data.length > 0 ){
                var tpl = $("#cateid_list_tpl").html();
                laytpl(tpl).render(res, function(render){
                    $("#cate_id").html('<option value="0">请选择</option>'+render);
                });
            }
        });
	}
	if(aid != ''){
	    start();
	}
	$('[name=cate_id]').change(function(){
		cate_id = $(this).val();
		if(func == true){
			select_cate();
		}
	});
</script>